<?php
class ErrorController extends Pidguin_Controller_Action
{
	public function init()
	{
		
	}
	
	public function errorAction()
    {
        $errors = $this->_getParam('error_handler');
        
        switch ($errors->type) {
            case \Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case \Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');
                $content = 'Page not found';
                break;
            default:
                $this->getResponse()->setRawHeader('HTTP/1.1 501 Internal server error');
                $content = $errors->exception->getMessage();
                break;
        }
        $this->getResponse()->clearBody(); 
        $this->view->content = $content;
    }
}